#include <iostream>
#include <vector>
using namespace std;

void saddlepoint(vector<vector<int>>A){
    int row,column;
    row=A.size();
    column=A[0].size();
    int Row[row];
    int Col[column];
    for (int i=0; i<row; i++){
        Row[i]=0;
        for (int j=1; j<column; j++){
            if (A[i][Row[i]]>A[i][j]) Row[i]=j;//第i行最小的是第j列的元素
        }
    }
    for (int j=0; j<column; j++){
        Col[j]=0;
        for (int i=1;i<row;i++){
            if (A[Col[j]][j]<A[i][j]) Col[j]=j;//第j列最大的是第i行的元素
        }
    }
    for (int i=0; i<row; i++){
        if (Col[Row[i]]==i)cout<<i<<" "<<Row[i]<<endl;
    }

}
int main(){
    vector<vector<int>> A={{10, 20, 30}, {1, 6, 4}, {9, 2, 7}};
    saddlepoint(A);
    return 0;
}